import request from '@/utils/request'

//登录方法接口
export function login(params) {
	return request({
		'url': '/member/login',
		headers: {
			isToken: false
		},
		'method': 'get',
		params
	})
}
//验证手机号是否注册
export function verifyphone(data) {
	return request({
		url: '/member/registerUnique',
		headers: {
			isToken: false
		},
		method: 'get',
		data: {
			mobile: data
		}
	})
}
//获取手机验证码
export function getCode(data, isRegister) {
	return request({
		url: '/member/registerValidate',
		headers: {
			isToken: false
		},
		method: 'get',
		data: {
			mobile: data,
			isRegister: isRegister
		}
	})
}

//获取区县方法
export function getArea() {
	return request({
		url: '/member/registerArea',
		headers: {
			isToken: false
		},
		method: 'get',
	})
}
//获取学校方法
export function getSchool(data) {
	return request({
		url: '/member/registerSchool',
		headers: {
			isToken: false
		},
		method: 'get',
		'data': {
			code: data
		}
	})
}
//获取学段方法
export function getPeriod(data) {
	return request({
		url: '/member/registerPeriod',
		headers: {
			isToken: false
		},
		method: 'get',
		'data': {
			schoolCode: data
		}
	})
}
//获取学科方法
export function getSubject() {
	return request({
		url: '/member/registerSubject',
		headers: {
			isToken: false
		},
		method: 'get',
	})
}

// 注册方法接口
export function register(data) {

	return request({
		url: '/member/register',
		headers: {
			isToken: false
		},
		method: 'get',
		data
	})
}

// 重置密码方法接口
export function forgotPassword(data) {

	return request({
		url: '/member/forgotPassword',
		headers: {
			isToken: false
		},
		method: 'get',
		data
	})
}

//获取个人信息方法
export function getInfo(params) {
	return request({
		'url': '/member/myCenter',
		headers: {
			isToken: false
		},
		'method': 'get',
		'params': params
	})
}

// 退出方法
export function logout() {
	return request({
		'url': 'member/loginout',
		'method': 'post'
	})
}

// 获取验证码
export function getCodeImg() {
	return request({
		'url': '/captchaImage',
		headers: {
			isToken: false
		},
		method: 'get',
		timeout: 20000
	})
}